import torch


def load_best_model(model, save_path):
    model.load_state_dict(
        torch.load(
            save_path,
            weights_only=True,
            map_location="cuda" if torch.cuda.is_available() else "cpu",
        )
    )
    model.eval()
    print("Loaded best model from:", save_path)
    return model
